%% Load data
%%-----------------------------
load('EEG_project/Subject_1/record.mat')
load('EEG_project/Subject_1/header.mat')
load('EEG_project/Subject_1/results.mat')
%% Actual results
%%------------------------------
subplot(2,1,1);resultView(Hyp3022,'sec');
%% Show first miniute data
[d,t]  = getDataAtTime(record1,7000,10,1);
 electrodesToShow =  1:1;
 subplot(2,1,2);plotData(t,d(electrodesToShow,:),hdr1.label(electrodesToShow),'sec')
hold on;plot(t,myFilter(d,[0.001 15]),'r');
 
 %% Find frequency
 electrodesToShow =  1:1;
 start_time = 7000;
 duration=15;
 freq_vec = zeros(duration,2);
 for i=1:duration;
     [d,t] = getDataAtTime(record1,start_time + i,2,electrodesToShow);
     d_filt = filterBank(d(electrodesToShow,:));figure;
     freq_vec(i,1) = getFrequency(d(electrodesToShow,:),1);
     freq_vec(i,2) = getFrequency(d_filt(electrodesToShow,:));
 end
 time_vec = start_time:(start_time+duration-1);
 figure;plot(time_vec,freq_vec(:,1),'b',time_vec,freq_vec(:,2),'r')